home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96b.txt
/
000054_icon-group-sender _Thu Nov 7 10:05:05 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1997-01-02
|
1KB
Received: by cheltenham.cs.arizona.edu; Thu, 7 Nov 1996 12:45:17 MST
Message-Id: <199611071816.TAA16271@manaslu.inforoute.cgs.fr>
Comments: Authenticated sender is <grodzens@inforoute.cgs.fr>
From: "Vladimir" <grodzens@InfoRoute.CGS.Fr>
To: stephen parker <stephen@lila.york.ac.uk>
Date: Thu, 7 Nov 1996 10:05:05 +0000
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
Subject: Re: sets and structures
Cc: icon-group@cs.arizona.edu
Priority: urgent
X-Mailer: Pegasus Mail for Win32 (v2.42)
Errors-To: icon-group-errors@cs.arizona.edu
On 7 Nov 96 at 7:14, you wrote:
> as you would expect for a list rather than a set. so, what's the
> answer if you want to form a set of non-atomic types? do i have to
> do it by hand?
>
It happens because your records are -equivalent- (having the same
values) but not -identical-. You can easily verify how it works.
Let's say S:= set()
rec_1:= rec(a, b)
insert(S, rec_1)
insert(S, rec_1)
the set S still has one element.
Another experience:
rec_1:= rec(a, b)
insert(S, rec_1)
rec_2:= rec_1
insert(S, rec_2)
The set S still has one element.
You can try another experience:
rec_1:= rec(a, b)
insert(S, rec_1)
rec_1:= rec(a, c) # assign a new value to rec_1
insert(S, rec_1)
Here a new element has been inserted!
BTW, why don't you have the Icon book? :-)